const express = require('express'); 
const pool = require('../pool');
const router = express.Router();

router.get('/list',(req,res,next)=>{
    let obj = req.obj;
    pool.query('select title,n_time,count,img,src from news',(err,r)=>{
        if(err){
            return next(err)
        }
        res.send({code:200,msg:'',data:r})
    })
})

router.get('/dail',(req,res,next)=>{
    let obj = req.obj;
    pool.query('select n_count from news_dail',(err,r)=>{
        if(err){
            return next(err);
        };
        res.send({code:200,msg:'',data:r})
    })
})
module.exports = router;